import requests
import json
import base64
import encry_util




def calc_captcha(bg,front):
    data ={
        "Background_ImageBase64":bg,
        "Gap_ImageBase64":front
    }
    headers = {
        "Content-Type": "application/json",
    }
    json_obj = requests.post("http://1.116.20.157:6688/SliderMode_AloneGap",data=json.dumps(data),headers=headers).json()
    x_pos = json_obj['result']['target'][0]
    print("识别成功：" + str(x_pos))
    return x_pos

